package com.ngc.mall.controller;

import com.ngc.mall.dto.SkuDTO;
import com.ngc.mall.service.ISkuService;
import io.swagger.annotations.Api;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;
/**
 * SKU信息
 *
 * @author: chenxiaolin
 * @date 2023/4/4 8:56
**/
@RestController
@RequestMapping("/sku")
@Api(tags = "sku")
public class SkuController {
    @Resource
    private ISkuService skuService;


    /**
     * 为指定spu批量创建sku
     */
    @PostMapping("/create/{id}")
    public Boolean createSku(@RequestBody List<SkuDTO> skuDTOList, @PathVariable Long id){
        return skuService.createBatchBySpuId(id,skuDTOList);
    }
}
